#define _CRT_SECURE_NO_WARNINGS   1

#include"BT.h"


BTNode* BuyNode(BinaryTreeType x)
{
	BTNode* node = (BTNode*)malloc(sizeof(BTNode));
	if (node == NULL) {
		perror("malloc error");
		return NULL;
	}
	node->x = x;
	return node;
}

void PrePrint(BTNode* root)
{
	if (root==NULL)
	{
		printf("NULL ");
		return;
	}
	printf("%d ",root->x);
	PrePrint(root->left);
	PrePrint(root->right);



}
void MidPrint(BTNode* root)
{
	if (root == NULL)
	{
		printf("NULL ");
		return;
	}
	
	MidPrint(root->left);
	printf("%d ", root->x);
	MidPrint(root->right);



}
void AfterPrint(BTNode* root)
{
	if (root == NULL)
	{
		printf("NULL ");
		return;
	}

	AfterPrint(root->left);
	AfterPrint(root->right);
	printf("%d ", root->x);


}